import torch
from torch import nn
import torch.nn.functional as F

input = torch.tensor([[1,2,3,4,5],
                      [6,7,8,9,0],
                      [1,2,3,4,5],
                      [6,7,8,9,0],
                      [6,5,4,3,2]])

kernel = torch.tensor([[1,2,3],
                       [4,5,6],
                       [7,8,9]])
print(input.shape)
# use torch change shape
input = torch.reshape(input,(1,1,5,5))
kernel = torch.reshape(kernel,(1,1,3,3))
print(input.shape)

# padding ill size
output = F.conv2d(input,kernel,stride=1)
print(output)